package com.zdy.dao;

import com.zdy.pojo.Books;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by 逸足天涯
 * on 3/13/2020.
 */
public interface BookMapper {
    //增加一本书
    int addbook(Books books);
    //删除一本书
    int deleteBooks( int id);
    //更新一本书
    int updateBooks(Books books);
    //查询全部书
    List<Books> queryAllBooks();
    //使用注解查询一条数据
    @Select("select * from books where bookID = #{bookID}")
    Books queryOneBookById(@Param("bookID") int id);

    @Select("select * from books where bookName = #{bookName}")
    Books queryBookByName(@Param("bookName") String  bookName);

}

